package com.admin.system.constant;

import com.admin.common.constant.Constant;

/**
 * 常数
 *
 * @author sq-lan
 */
public class SystemConstant {

    public static String os = System.getProperty("os.name");

    public static final String FILE_PATH_MAC = "~";

    public static final String FILE_PATH_LINUX = "/home";

    public static final String FILE_PATH_WINDOWS = "C:";

    public static final String FILE_PATH_PREFIX = "/baseAdmin/file/";

    public static final String FILE_PATH_AVATAR = "/avatar/";
    public static final String FILE_PATH_OTHER = "/other/";

    public static String pathPrefix() {
        String osPath;
        if (os.toLowerCase().startsWith(Constant.WIN)) {
            osPath = FILE_PATH_WINDOWS;
        } else if (os.toLowerCase().startsWith(Constant.MAC)) {
            osPath = FILE_PATH_MAC;
        } else {
            osPath = FILE_PATH_LINUX;
        }
        return osPath + FILE_PATH_PREFIX;
    }

    public static String otherPath() {
        return pathPrefix() + FILE_PATH_OTHER;
    }

    public static String avatarPath() {
        return pathPrefix() + FILE_PATH_AVATAR;
    }
}
